﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using Apps.Models;
using System.Data;

namespace Apps.DAL.HC
{
    public partial class HC_FORMDATA_Repository : DbContext<HC_FORMDATA>
    {
        public bool DoAdd(HC_FORMDATA formModel)
        {
            return Db.Insertable(formModel).ExecuteCommand() > 0;
        }

        public List<HC_FORMDATA> GetList(string itemId, int pageIndex, int pageSize, string sortFiled, string orderBy, ref int totalCount)
        {
            return Db.Queryable<HC_FORMDATA>().OrderBy(sortFiled + " " + orderBy).Where(x => x.ITEMID == itemId).ToPageList(pageIndex, pageSize, ref totalCount);
        }
    }
}
